package com.css.service.impl;

import java.util.List;

import com.css.dao.IEmployeeDAO;
import com.css.service.IEmployeeService;
import com.css.vo.Employee;

public class EmployeeService implements IEmployeeService {

	private IEmployeeDAO employeeDAO;

	public void setEmployeeDAO(IEmployeeDAO employeeDAO) {
		this.employeeDAO = employeeDAO;
	}

	@Override
	public void save(Employee employee) {
		employeeDAO.save(employee);
	}

	@Override
	public void delete(Employee employee) {
		employeeDAO.delete(employee);
	}

	@Override
	public void update(Employee employee) {
		employeeDAO.update(employee);
	}

	@Override
	public Employee find(String employeeName) {
		return employeeDAO.find(employeeName);
	}

	@Override
	public List<Employee> findAllEmployee() {
		List list = employeeDAO.findAllEmployee();
		return list;
	}

	@Override
	public Employee findById(Integer id) {
		List<Employee> list = employeeDAO.findById(id);
		Employee Employee = list.get(0);
		return Employee;
	}

}
